/**
* Ejemplo Mapas - MapsCast
* Applicast(tm) Widget
*
* (c) 2009 ILERRED, S.L.
*/

//= require <prototype>
//= require <applicast/applicast>
//= require <applicast/maps>

//= require "mapscast.widget"
//= require "mapscast.viewbase"
//= require "mapscast.viewfs"

//= provide "../../assets"

//////////////////////////////////////////////////////
// Core Events
//////////////////////////////////////////////////////
var App = null;

function onLoad() {
  App = new Widget({fullscreen: true});
}

function onUpKey(type) {
  if ( type && type == 1 )  
    Event.fire('keypress', {keyCode: Event.KEY_UP});
}

function onDownKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_DOWN});
}

function onRightKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_RIGHT});
}

function onLeftKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_LEFT});
}

function onConfirmKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_CONFIRM});
}

function onRedKey() {
  Event.fire('keypress', {keyCode: Event.KEY_RED});
}

function onBlueKey() {
  Event.fire('keypress', {keyCode: Event.KEY_BLUE});
}

function onGreenKey() {
  Event.fire('keypress', {keyCode: Event.KEY_GREEN});
}

function onYellowKey() {
  Event.fire('keypress', {keyCode: Event.KEY_YELLOW});
}